package com.example.mapper;

import com.example.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface AdminMapper {

    /*
      * 管理员登录-cyp
     */
    @Select("select * from admin_ where id = #{id}")
    User selectByUserid(Integer  id );

    /*
      * 管理员注册-cyp
     */
    @Insert("insert into admin_(name,password,role,sex,address,phone,email)"+
   " values(#{name},#{password},#{role},#{sex},#{address},#{phone},#{email})")
    void insert(User user);

    /*
      * 管理员修改-cyp
     */
    @Update("update admin_ set name=#{name},password=#{password},sex=#{sex},"+
            "address=#{address},phone=#{phone} email=#{email} where id=#{id}")
    void updateById(User user);




}
